bitkeeper revision 1.1159.113.3 (41723f7fO8wKQjhPjoowbDHAwaKf-g)
authorkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Sun, 17 Oct 2004 09:46:39 +0000 (09:46 +0000)
committerkaf24@freefall.cl.cam.ac.uk <kaf24@freefall.cl.cam.ac.uk>
Sun, 17 Oct 2004 09:46:39 +0000 (09:46 +0000)
Always check shadow time values are up to date in time interrupt.

linux-2.4.27-xen-sparse/arch/xen/kernel/time.c
linux-2.6.8.1-xen-sparse/arch/xen/i386/kernel/time.c

index 01584bda33892f46534a2f22270dcd3af8537ca9..9ff844d70e2c5a20020a0df17bee347d5bcc23b0 100644 (file)
@@ -393,14 +393,17 @@ static inline void do_timer_interrupt(int irq, void *dev_id,
     unsigned long ticks = 0;
     long sec_diff;
 
- retry:
-    __get_time_values_from_xen();
+    do {
+        __get_time_values_from_xen();
+        
+        delta = (s64)(shadow_system_time + 
+                      (__get_time_delta_usecs() * 1000) -
+                      processed_system_time);
+    }
+    while ( !TIME_VALUES_UP_TO_DATE );
 
-    if ( (delta = (s64)(shadow_system_time + __get_time_delta_usecs() * 1000 -
-                                               processed_system_time)) < 0 )
+    if ( unlikely(delta < 0) )
     {
-               if (!TIME_VALUES_UP_TO_DATE)
-                       goto retry;
         printk("Timer ISR: Time went backwards: %lld\n", delta);
         return;
     }
index 9b5c862892d4f30228e33b5a5c9dd61d9cdf9b59..15b68ba45d3999c041e537c8151fbadc83bd4d05 100644 (file)
@@ -367,15 +367,16 @@ static inline void do_timer_interrupt(int irq, void *dev_id,
        s64 delta, nsec;
        long sec_diff, wtm_nsec;
 
- retry:
-       __get_time_values_from_xen();
+       do {
+               __get_time_values_from_xen();
+
+               delta = (s64)(shadow_system_time +
+                             (cur_timer->get_offset() * NSEC_PER_USEC) -
+                             processed_system_time);
+       }
+       while (!TIME_VALUES_UP_TO_DATE);
 
-       delta = (s64)(shadow_system_time +
-                     (cur_timer->get_offset() * NSEC_PER_USEC) -
-                     processed_system_time);
-       if (delta < 0) {
-               if (!TIME_VALUES_UP_TO_DATE)
-                       goto retry;
+       if (unlikely(delta < 0)) {
                printk("Timer ISR: Time went backwards: %lld %lld %ld %lld\n",
                       delta, shadow_system_time,
                       (cur_timer->get_offset() * NSEC_PER_USEC),